-
Notifications
You must be signed in to change notification settings - Fork 714
fix: Ensure logs are not interrupted when disk is full #4603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| func (pw *discardWriter) Write(p []byte) (int, error) { | ||
| n, err := pw.writer.Write(p) | ||
| if err != nil && errors.As(err, new(syscall.Errno)) { | ||
| return len(p), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you trying to do in this PR?
Doesn't seem correct to discard all syscall errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I make a mistack. @AkihiroSuda
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…nd later recovers. Signed-off-by: ningmingxiao <[email protected]>
b496b85 to
89876b5
Compare
|
|
||
| func (pw *discardWriter) Write(p []byte) (int, error) { | ||
| n, err := pw.writer.Write(p) | ||
| if err != nil && errors.Is(err, syscall.ENOSPC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of ENOSPC, the write should be retried with sleep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I afraid that if long term retry failed the container main process may hang, because pipe is full.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to retry forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how long do you think is appropriate? @AkihiroSuda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If retry with some sleep I afraid that the consumer's consumption of container logs is slower than the producer's production of logs.
fix /var/lib/nerdctl dir is full and container's log can't continue even space is freed up. @AkihiroSuda
containerd loguri=file containerd/containerd#12488 also have this problem